package com.urbane.mybatis;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.urbane.mybatis.entity.BaseEntity;
import org.junit.jupiter.api.Test;

public class MybatisPlusTest {

    @Test
    public void testMPQuery() {
        // 创建 LambdaQueryWrapper
        LambdaQueryWrapper<BaseEntity> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(BaseEntity::getId, "张三");

    }

    @Test
    public void testMPUpdate() {
        // 创建 LambdaUpdateWrapper
        LambdaUpdateWrapper<BaseEntity> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
        lambdaUpdateWrapper.set(BaseEntity::getId, "李四");
    }
}
